<%--
    Document   : register
    Created on : Jun 3, 2014, 3:38:35 AM
    Author     : Yogesh
    Auto7.1

--%>

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>

<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>

<html:html lang="true">

<jsp:include page="header.jsp"/>
 <li><a href="login.jsp">Login</a></li>
   

         </ul>
        </nav>


  </div>
 </div>






<div style="position:relative;width: auto;z-index: 10000;">
    <div id="cssmenu" style="background-color: black;">
     <section class="innerpages">
         <div class="grid_12" style="background-image: url('commonfiles/images/satyapal.jpg'); width:100%;">
             <h1>Registration</h1>
         </div>
     </section>
</div>
</div>

 <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
 

    <script>
        /*
var geocoder;
var map;
var infowindow = new google.maps.InfoWindow();
var marker;
var latitude;
var longitude;
function initialize() {

    if(navigator.geolocation) {
    navigator.geolocation.getCurrentPosition(function(position) {

       // alert(position.coords.latitude+"    "+position.coords.longitude);
        latitude=position.coords.latitude;
        longitude=position.coords.longitude;
        codeLatLng();

    }, function() {
      handleNoGeolocation(true);
    });
  }


  geocoder = new google.maps.Geocoder();
  var latlng = new google.maps.LatLng(latitude,longitude);
  var mapOptions = {
    zoom: 8,
    center: latlng,
    mapTypeId: 'roadmap'
  }
  map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);


}

function codeLatLng() {

  var lat = parseFloat(latitude);
  var lng = parseFloat(longitude);
  var latlng = new google.maps.LatLng(lat, lng);


  geocoder.geocode({'latLng': latlng}, function(results, status) {
    if (status == google.maps.GeocoderStatus.OK) {
      if (results[1]) {

      //  alert(results[1].formatted_address);
        var str=results[1].formatted_address+"";

            if ( str.search("India") == -1 ){
                   document.write("Does not contain Apples" );
            }else{
                outputdiv = document.getElementById('country');
                 outputdiv.innerHTML = "<input type='text' style=\"background-image:url('https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQ3fWoMNTkjSSIB3yjB2EshnJsLX8fsrfgHLczVFQFeLitTcDsC');background-repeat:no-repeat;padding-left:20px; height:26px; \" value='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;India'/>";
            }



      } else {
      
        outputdiv = document.getElementById('country');
                 outputdiv.innerHTML = "<input type='text' placeholder=\"We Are Fail To Locate Your Country,Please Fill It Manually\" style=\"height:26px; \"/>";

      }
    } else {
    
      outputdiv = document.getElementById('country');
                 outputdiv.innerHTML = "<input type='text'  placeholder=\"Opps Something Went Wrong,Please Fill Country Manually\" style=\"height:26px; \"/>";
 
    }
  });
}

google.maps.event.addDomListener(window, 'load', initialize);

    */
    
    
        </script>

 
    
<div class="block2">
    <div class="re">
    <div class="regs1">

         <div >
            <h1 style="padding: 9px 0 24px; font-size: 28px; line-height: 36px">
                Connect with Vehicalhai.com<br>Fulfill the dream of your car.. </h1>
         </div>
        <div style="width: 625px;">
            <ul class="our_process">
              <li class="img1" type="none">
                <h4>Step1: Client</h4>
                <p>A brand new car at just the Down payment? People who have always dreamed of owning a car but found- the Down payment a little too heavy on the pocket can drive away in a brand new world of art.
For purchasing your dream car through vehicle hai.com, first select the car you wish to own by just paying its 50% down payment.
For this, register your details on vehiclehai.com.  As soon as your name gets registered, you get an instant call on the number registered by the service center.
 </p>
              </li>
              <li class="img2" type="none">
                <h4>Step2: VehicleHai</h4>
                <p>As soon as you are registered with vehiclehai.com, you get an immediate service by the customer execu
tive as per your required dream vehicle.
The customer executive will provide you with all the terms and conditions and the policies of the company.
  </p>
              </li>
             <li class="img3" type="none">
                <h4>Step3:Financers</h4>
                <p>The ways to promote the brand by the company is diversified to a different level, managing all the activities regarding sales generation to the high level by some innovative ideas.  </p>
              </li>
              <li class="img4" type="none">
                <h4>Step4:Advertisements</h4>
                <p>For free EMI car, the company will post an advertisement on the doors of your car for the term of 5 years. </p>
              </li>
            </ul>
    </div>
    </div>
    <div class="registerform">
            


 <style>
		.meter {
			height: 15px;  /* Can be anything */
			width: 504px;


			-moz-border-radius: 25px;
			-webkit-border-radius: 25px;


			-webkit-box-shadow: inset 0 -1px 1px rgba(255,255,255,0.3);
			-moz-box-shadow   : inset 0 -1px 1px rgba(255,255,255,0.3);
			box-shadow        : inset 0 -1px 1px rgba(255,255,255,0.3);
		}
		.meter > span {
			display: block;
			height: 100%;
			   -webkit-border-top-right-radius: 8px;
			-webkit-border-bottom-right-radius: 8px;
			       -moz-border-radius-topright: 8px;
			    -moz-border-radius-bottomright: 8px;
			           border-top-right-radius: 8px;
			        border-bottom-right-radius: 8px;
			    -webkit-border-top-left-radius: 20px;
			 -webkit-border-bottom-left-radius: 20px;
			        -moz-border-radius-topleft: 20px;
			     -moz-border-radius-bottomleft: 20px;
			            border-top-left-radius: 20px;
			         border-bottom-left-radius: 20px;
			background-color: rgb(43,194,83);
			background-image: -webkit-gradient(
			  linear,
			  left bottom,
			  left top,
			  color-stop(0, rgb(43,194,83)),
			  color-stop(1, rgb(84,240,84))
			 );
			background-image: -moz-linear-gradient(
			  center bottom,
			  rgb(43,194,83) 37%,
			  rgb(84,240,84) 69%
			 );
			-webkit-box-shadow:
			  inset 0 2px 9px  rgba(255,255,255,0.3),
			  inset 0 -2px 6px rgba(0,0,0,0.4);
			-moz-box-shadow:
			  inset 0 2px 9px  rgba(255,255,255,0.3),
			  inset 0 -2px 6px rgba(0,0,0,0.4);
			box-shadow:
			  inset 0 2px 9px  rgba(255,255,255,0.3),
			  inset 0 -2px 6px rgba(0,0,0,0.4);
			position: relative;
			overflow: hidden;
		}
		.meter > span:after, .animate > span > span {
			content: "";
			position: absolute;
			top: 0; left: 0; bottom: 0; right: 0;
			background-image:
			   -webkit-gradient(linear, 0 0, 100% 100%,
			      color-stop(.25, rgba(255, 255, 255, .2)),
			      color-stop(.25, transparent), color-stop(.5, transparent),
			      color-stop(.5, rgba(255, 255, 255, .2)),
			      color-stop(.75, rgba(255, 255, 255, .2)),
			      color-stop(.75, transparent), to(transparent)
			   );
			background-image:
				-moz-linear-gradient(
				  -45deg,
			      rgba(255, 255, 255, .2) 25%,
			      transparent 25%,
			      transparent 50%,
			      rgba(255, 255, 255, .2) 50%,
			      rgba(255, 255, 255, .2) 75%,
			      transparent 75%,
			      transparent
			   );
			z-index: 1;
			-webkit-background-size: 50px 50px;
			-moz-background-size: 50px 50px;
			-webkit-animation: move 2s linear infinite;
			   -webkit-border-top-right-radius: 8px;
			-webkit-border-bottom-right-radius: 8px;
			       -moz-border-radius-topright: 8px;
			    -moz-border-radius-bottomright: 8px;
			           border-top-right-radius: 8px;
			        border-bottom-right-radius: 8px;
			    -webkit-border-top-left-radius: 20px;
			 -webkit-border-bottom-left-radius: 20px;
			        -moz-border-radius-topleft: 20px;
			     -moz-border-radius-bottomleft: 20px;
			            border-top-left-radius: 20px;
			         border-bottom-left-radius: 20px;
			overflow: hidden;
		}

		.animate > span:after {
			display: none;
		}

		@-webkit-keyframes move {
		    0% {
		       background-position: 0 0;
		    }
		    100% {
		       background-position: 50px 50px;
		    }
		}



		.red > span {
			background-color: blue;
			background-image: -moz-linear-gradient(top, #f0a3a3, #f42323);
			background-image: -webkit-gradient(linear,left top,left bottom,color-stop(0, #f0a3a3),color-stop(1, #f42323));
			background-image: -webkit-linear-gradient(#f0a3a3, #f42323);
		}

		.nostripes > span > span, .nostripes > span:after {
			-webkit-animation: none;
			background-image: none;
		}
	</style>

<script language="JavaScript">

//Auther @Yogesh Paisode
//Ask @Mobile Number 8550900381

var flag=0;
var name1="";
var email1="";
var f11=1;


 function onlyAlphabets(e, t) {
            try {
                if (window.event) {
                    var charCode = window.event.keyCode;
                }
                else if (e) {
                    var charCode = e.which;
                }
                else { return true; }
                if ((charCode > 64 && charCode < 91) || (charCode > 96 && charCode < 123))
                    return true;
                else
                    return false;
            }
            catch (err) {
                alert(err.Description);
            }
}



function mob(){


            if(flag==0){
                 alert("Invalid Mobile Number");

                    emailChk.value="";

                }


}






function checkPass()
{
    var pass1 = document.getElementById('pass1');
    var pass2 = document.getElementById('pass2');
    var message = document.getElementById('confirmMessage');
    var goodColor = "#66cc66";
    var badColor = "#ff6666";
    if(pass1.value == pass2.value){
        pass2.style.backgroundColor = goodColor;
        message.style.color = goodColor;
        message.innerHTML = "Passwords Match!"
    }else{
        pass2.style.backgroundColor = badColor;
        message.style.color = badColor;
        message.innerHTML = "Passwords Do Not Match!"
    }
}


function run(){

        if(document.getElementById('pass2').value==""||document.getElementById('pass1').value==""||document.getElementById('emailChk').value==""||document.getElementById('mob').value==""||document.getElementById('firstName1').value==""||document.getElementById('lastName1').value==""){}
        else{
                outputdiv = document.getElementById('run');
		outputdiv.innerHTML = '<div class="meter red"><span style="width: 100%"></span></div>';

                var temp=document.getElementById("firstName1");
                name1=temp.value;

                var temp1=document.getElementById("emailChk");
                email1=temp1.value;

                outputdiv = document.getElementById('demo');
                outputdiv.innerHTML = '<p><font color="green">'+name1+' Please Wait..<br>We Are Preparing</font></p>';
                var myVar=setInterval(function(){myTimer()},2000);

           }//End of else

}//End of run()




function myTimer() {


    if(flag==0){
         outputdiv = document.getElementById('demo');
         outputdiv.innerHTML = '<p><font color="green">'+name1+' Please Wait..<br>We Are Uploading Your Data</font></p>';
         flag=1;
    }else if(flag==1){
         outputdiv = document.getElementById('demo');
         outputdiv.innerHTML = '<p><font color="green">'+name1+' Please Wait..<br>We Are Sending Your  Verification Link To Your EmailId</font></p>';
         flag=2;
    }if(flag==2){
        outputdiv = document.getElementById('demo');
         outputdiv.innerHTML = '<p><font color="green">'+name1+' Please Wait..<br>We Are Sending Verification Link At '+email1+'</font></p>';
         flag=0;
    }

}


function mob(){


        var t=document.getElementById("mob");
        var t1=t.value;

        if(t1==10||t1==12){
            flag=1;
        }

        if(t1<10){
            flag=0;
        }

        if(t1.substr(0,2)=="91"){

                            t.value = t1.substring(2);
        }

}

function clr1(){
    outputdiv = document.getElementById('clr');
	outputdiv.innerHTML = "";
}


function checnum(as)
{
	var dd = as.value;

        //alert(dd.length);


        if(dd.length==10||dd.length<10){

            if(isNaN(dd))
                    {
                            dd = dd.substring(0,(dd.length-1));
                            as.value = dd;
                    }

        }
        else{


             dd = dd.substring(0,(dd.length-1));
                            as.value = dd;
        }

        if(dd.length==10){
            flag=1;
        }

        if(dd.length<10){
            flag=0;
        }


}
//Auther @Yogesh Paisode
//Ask @Mobile Number 8550900381

	</script>

              <div id="signup" name="Register_Model">


                            <html:form  action="/Step1">

                                 <h1>Step 1:Register Here.</h1>
                                 <input type="text" onclick="clr1()" onchange="clr1()" placeholder="First Name" required="" name="firstName" id="firstName1" onkeypress="return onlyAlphabets(event,this);">
                                 <input type="text"  placeholder="Last Name" required="" name="lastName" id="lastName1" onkeypress="return onlyAlphabets(event,this);">
                                 <input type="text"  placeholder="Mobile Number" required="" name="mobileNumber" id="mob" onkeyup=checnum(this) onchange="mob()" onkeypress="checnum(this)">
                                <input type="email"  placeholder="Email" required="" name="emailId" id="emailChk" onkeypress="mob(this)" ondblclick="mob(this)" onchange="mob(this)">
                                <div id="clr">  <html:errors property="errors.emailTacken"/></div>
                                <input type="password"  placeholder="Choose your password" required="" name="password" id="pass1">
                                <span id="confirmMessage"  class="confirmMessage"></span><br>
                                <input type="password"  placeholder="Confirm password" required="" name="confirmPassword" id="pass2" onkeyup="checkPass(); return false;">


                                


        <%

                 String ipAddress="";
                 String flag="1";
                 String countryflag="";

                 java.net.InetAddress ip;

                try {

                        ip = java.net.InetAddress.getLocalHost();
                        ipAddress=ip.getHostAddress();

                    } catch (Exception e) {} 

                   // ipAddress="206.190.36.45"
                     //   ipAddress="192.168.2.1";

                  if(ipAddress.contains("192.168")||ipAddress.contains("127.0")||ipAddress.contains("255")){
                                    flag="0";
                      }


                 if(flag.equals("1")){

                              java.io.File file = new java.io.File("D:/Databases GeoLite/GeoLiteCity.dat");
                              com.maxmind.geoip.LookupService lookup = new com.maxmind.geoip.LookupService(file,com.maxmind.geoip.LookupService.GEOIP_MEMORY_CACHE);
                              com.maxmind.geoip.Location locationServices = lookup.getLocation(ipAddress);
                               

                  if(locationServices.countryCode.equals("IN")){
                        countryflag="https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcQ3fWoMNTkjSSIB3yjB2EshnJsLX8fsrfgHLczVFQFeLitTcDsC";
                      }
              else if(locationServices.countryCode.equals("US")){
                        countryflag="http://www.zenithpress.com/images/us-flag-small.jpg";
                      }

              else if(locationServices.countryCode.equals("AU")){
                        countryflag="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRW8ZR-xMZJppc0ii41loIk3dViA5thrqHpwAdzKEn64FGXbSEvgg";
                      }
              else if(locationServices.countryCode.equals("CA")){
                        countryflag="";
                      }
              else     if(locationServices.countryCode.equals("DE")){
                        countryflag="";
                      }
              else    if(locationServices.countryCode.equals("RU")){
                        countryflag="";
                      }
              else     if(locationServices.countryCode.equals("SG")){
                        countryflag="";
                      }
              else    if(locationServices.countryCode.equals("ZA")){
                        countryflag="";
                      }
              else    if(locationServices.countryCode.equals("LK")){
                        countryflag="https://encrypted-tbn3.gstatic.com/images?q=tbn:ANd9GcRtMMrE1-1wiX0-Rw_g80xzJDhN6c9IPlkt6KBbNFsogZXlwEMqWA";
                      }
              else    if(locationServices.countryCode.equals("ES")){
                        countryflag="";
                      }
                  else{
                          countryflag="";
                      }



                              out.print("<input type='text' style=\"background-image:url('"+countryflag+"');background-repeat:no-repeat;padding-left:20px; height:26px; \" value='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+locationServices.countryName+"'/>");

                     }
                 else{
                                out.print("We Are Unable To Trace Your Location Because,Your Computer Is In LAN<br><input type='text' style=\"background-image:url('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQAbbtspxcAEiT77MgZs30unI-uAE7abCAzEjpR1znC_0tdQR23wg');background-repeat:no-repeat;padding-left:20px; height:26px; \" placeholder=\"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please Enter Your Location Manually\"/>");

                     }

                  
        %>




     
                                <div id="run">

		                </div>
                                <p id="demo"></p>

                            <button type="submit" onclick="run()">Sign up for free!</button>


                            </html:form>

                            </div>

           </div>

</div>
</div>







<jsp:include page="footer.jsp"/>

</html:html>
